package com.xbb.service.impl;

import com.xbb.entity.Role;
import com.xbb.entity.Userroles;
import com.xbb.mapper.UserrolesMapper;
import com.xbb.service.IUserrolesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr xie
 * @since 2020-05-19
 */
@Service
public class UserrolesServiceImpl extends ServiceImpl<UserrolesMapper, Userroles> implements IUserrolesService {

    @Autowired
    UserrolesMapper userrolesMapper;

    @Override
    public List<Role> getRolesByUserId(Integer uid) {
        return userrolesMapper.getRolesByUserId(uid);
    }

    @Override
    public boolean delRolesByUserId(Integer uid, String rids) {
        return userrolesMapper.delRolesByUserId(uid,rids.split(","));
    }
}
